<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>历史干扰源查询</title>

<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
	function checkreturn(){
		window.location.href="InterferenceQuery.jsp";
	}
	
	// 打开编辑框
	function openHistoryInterferenceSourceDialog(){

		$("#flag").val(2);
		var selectedRows=$("#dg").datagrid("getSelections");
		if(selectedRows.length != 1){
			$.messager.alert("系统提示","请选择一条要编辑的数据！");
			return;
		}
		
		var row=selectedRows[0];
		$("#dlg").dialog("open").dialog("setTitle","修改历史干扰源信息");
		$("#fm").form("load",row);
		$("#flag").val(2);
		$("#createTime").attr("readonly", true);
    }
	
	// 关闭编辑框
	function closeHistoryInterferenceSourceDialog(){
		 $("#dlg").dialog("close");
		 resetValue();
	}
	
	// 提交数据
	function saveData(){
    	$("#fm").form("submit",{
			url:"${pageContext.request.contextPath}/interferencequery/saveData.do",
			success:function(result){
				var result=eval('('+result+')');
				if(result.success){
					$.messager.alert("系统提示","保存成功！");
					resetValue();
					$("#dlg").dialog("close");
					$("#dg").datagrid("reload");
				}else{
					$.messager.alert("系统提示","保存失败！");
					return;
				}
			}
		 });
    }
   	
	// 重置输入框
	function resetValue(){
		$("#line").val("");
		$("#time").val("");
		$("#problemSource").val("");
		$("#BSName1").val("");
		$("#BSName2").val("");
		$("#problemDescribe").val("");
		$("#rectification").val("");
		$("#infType").val("");
		$("#operator").val("");
		$("#sourcePosition").val("");
		$("#status").val("");
		$("#finishTime").val("");
		$("#belongs").val("");
		$("#assistPeople").val("");
		$("#process").val("");
	}
	
	function formatDatebox(value) {
		var datetimeType = "";
		var date =new Date(parseInt(value));
		datetimeType = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate() +" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()+" "+date.getMilliseconds();
		if(datetimeType != "NaN-NaN-NaN NaN:NaN:NaN NaN")
			return datetimeType;
	}
</script>
</head>

<body style="margin: 1px">
<%String FrontId = request.getParameter("FrontId");%>
<table id="dg" title="历史干扰源" class="easyui-datagrid" fitColumns="fasle" pagination="true" nowrap="false" rownumbers="true"  singleSelect="true"
	url="${pageContext.request.contextPath}/interferencequery/infhistorysource.do?frontId=<%=FrontId %>" fit="true" toolbar="#tb">
   <thead><tr>
   		<th field="cb" checkbox="true" align="center"></th>
   		<th field="line" width="70" align="center">线路</th>
   		<th field="time" width="80" align="center">问题发现日期</th>   		
   		<th field="problemSource" width="100" align="center">问题来源</th>
   		<th field="BSName1" width="90" align="center">基站</th>
   		<!-- <th field="BSName2" width="90" align="center">基站2</th> -->
   		<th field="problemDescribe" width="180" align="center">问题描述</th>
   		<th field="rectification" width="350" align="center">整改情况</th>
   		<th field="infType" width="100" align="center">干扰类型</th>
   		<th field="operator" width="80" align="center">运营商</th>
   		<th field="sourcePosition" width="100" align="center">干扰源位置</th>
   		<th field="status" width="60" align="center">问题状态</th>
   		<th field="finishTime" width="90" align="center">整改完成时间</th>
   		<th field="belongs" width="80" align="center">所属段</th>
   		<th field="assistPeople" width="80" align="center">运营商配合人员</th>
   		<th field="process" width="300" align="center">整改履历</th>
   		<th field="createTime" width="90" align="center"  formatter="formatDatebox">创建时间</th>
   		<th field="MCC" width="80" align="center">MCC</th>
   		<th field="MNC" width="80" align="center">MNC</th>
   		<th field="LAC" width="80" align="center">LAC</th>
   		<th field="CID" width="80" align="center">CID</th>
   		<th field="RELEV" width="80" align="center">RELEV</th>
   		<th field="TRXs" width="80" align="center">TRXs</th>
   	</tr></thead>
</table>
 
<div id="tb">
 	<div>
        <a href="javascript:openHistoryInterferenceSourceDialog()" class="easyui-linkbutton" iconCls="icon-edit" plain="true">修改历史干扰源</a>
 	</div>
 </div>
<div id="dlg" class="easyui-dialog" style="width:1050px;height:500px;font-size:15px;" closed="true" buttons="#dlg-buttons">
	<form id="fm" method="post">
		<table cellspacing="10px">
			<tr>
			<td style="text-align:center;width: 200px">线路:</td>
			<td ><input type="text" id="line" name="line" class="easyui-validatebox" style="width: 150px"/></td>
			<td style="text-align:center;width: 125px">问题发现日期:</td>
			<td ><input type="text" id="time" name="time" class="easyui-validatebox" style="width: 150px" /></td>
			<td style="text-align:center;width: 125px">问题来源:</td>
			<td ><input type="text" id="problemSource" name="problemSource" class="easyui-validatebox" style="width: 300px"/></td>
		</tr>
		<tr>
			<td style="text-align:center;width: 200px">基站:</td>
			<td><input type="text" id="BSName1" name="BSName1" class="easyui-validatebox" /></td>
			<td style="text-align:center;width: 125px" ></td>
			<td><input type="hidden" id="BSName2" name="BSName2" class="easyui-validatebox" /></td>
			<td style="text-align:center;width: 125px">问题描述:</td>
			<td><input type="text" id="problemDescribe" name="problemDescribe" class="easyui-validatebox" style="width: 300px"/></td>
		</tr>
		<tr>
		    <td style="text-align:center;width: 200px">整改情况:</td>
			<td style="width: 800px" colspan="5"><textarea name="rectification" cols="38" rows="6"  id="rectification" wrap="hard" style="width: 900px"></textarea></td>
		</tr>
		<tr>
				<td style="text-align:center;width: 200px">干扰类型:</td>
			<td><input type="text" id="infType" name="infType" class="easyui-validatebox" /></td>
			<td style="text-align:center;width: 125px">运营商:</td>
			<td><input type="text" id="operator" name="operator" class="easyui-validatebox" /></td>
			<td style="text-align:center;width: 125px">干扰源位置:</td>
			<td><input type="text" id="sourcePosition" name="sourcePosition" class="easyui-validatebox" style="width: 300px"/></td>
		</tr>
		<tr>
			<td style="text-align:center;width: 200px">问题状态:</td>
			<td><input type="text" id="status" name="status" class="easyui-validatebox" /></td>
			<td style="text-align:center;width: 125px">整改完成时间:</td>
			<td><input type="text" id="finishTime" name="finishTime" class="easyui-validatebox" /></td>
			<td style="text-align:center;width: 125px">所属段:</td>
			<td><input type="text" id="belongs" name="belongs" class="easyui-validatebox" style="width: 300px"/></td>
		</tr>
		<tr>
			<td style="text-align:center;width: 200px">运营商配合人员:</td>
			<td colspan="3"><input type="text" id="assistPeople" name="assistPeople" class="easyui-validatebox" style="width: 400px"/></td>
			<td style="text-align:center;width: 125px">创建时间:</td>
			<td><input type="text" id="createTime" name="createTime" class="easyui-validatebox" style="width: 300px"/></td>
		</tr>
		<tr>
		    <td style="text-align:center;width: 200px">整改履历表:</td>
			<td style="width: 800px" colspan="5"><textarea name="process" cols="38" rows="6"  id="process" wrap="hard" style="width: 900px"></textarea></td>
			<td colspan="4">
   				<input type="hidden" id="flag" name="flag"/>
   			</td>
		</tr>
		<tr>
			<td style="text-align:center;width: 200px">MCC:</td>
			<td><input type="text" id="MCC" name="MCC" class="easyui-validatebox" /></td>
			<td style="text-align:center;width: 125px">MNC:</td>
			<td><input type="text" id="MNC" name="MNC" class="easyui-validatebox"  /></td>
			<td style="text-align:center;width: 125px">LAC:</td>
			<td><input type="text" id="LAC" name="LAC" class="easyui-validatebox" style="width: 300px"/></td>
		</tr>
		<tr>
			<td style="text-align:center;width: 200px">CID:</td>
			<td><input type="text" id="CID" name="CID" class="easyui-validatebox" /></td>
			<td style="text-align:center;width: 125px">RELEV:</td>
			<td><input type="text" id="RELEV" name="RELEV" class="easyui-validatebox"/></td>
			<td style="text-align:center;width: 125px">TRXs:</td>
			<td><input type="text" id="TRXs" name="TRXs" class="easyui-validatebox" style="width: 300px"/></td>
		</tr>
		</table>
	</form>
</div>
<div id="dlg-buttons" style="text-align:center">
 	<a href="javascript:saveData()" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
 	<a href="javascript:closeHistoryInterferenceSourceDialog()" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
</div>
</body>
</html>